#pragma once

class CStringConvert
{
private:
	static UINT m_nDefaultCodePage;


	LPCSTR m_pMultiByteString;
	LPCWSTR m_pWideCharString;
	UINT m_nCodePage;

	void* m_pLargeStringBuffer;
	unsigned char m_smallStringBuffer[128];

	void* AllocStringBuffer(int nSize);

public:
	CStringConvert(LPCSTR pMultiByteString, UINT nCodePage = GetDefaultCodePage());
	CStringConvert(LPCWSTR pWideCharString, UINT nCodePage = GetDefaultCodePage());

	~CStringConvert(void);

	operator LPCSTR();
	operator LPCWSTR();

	static void SetDefaultCodePage(UINT nCodePage);
	static UINT GetDefaultCodePage();

};
